import { GoodsEntity } from "@/interfaces/GoodsEntity"


const getSelfGoodsForm = ( item?: GoodsEntity) => {

    return [{
        type: "avatar",
        name: "avatar",
        label: "封面"
    }, {
        type: "input",
        name: "menu",
        label: "分类*",
        defaultValue: item?.menu || "默认"
    }, {
        type: "input",
        name: "name",
        label: "标题",
        defaultValue: item?.name,
        require: true
    }, {
        type: "input",
        name: "information",
        label: "描述",
        defaultValue: item?.information
    }, {
        type: "number",
        name: "price",
        label: "价格*",
        defaultValue: (item?.price || 0) / 100,
        step: 0.01
    }, {
        type: "option",
        name: "status",
        label: "是否上架",
        defaultValue: item?.status,
        options: [{
            name: "上架",
            value: 1
        }, {
            name: "售罄",
            value: 0
        }]
    }]
}
export default getSelfGoodsForm